/**
 * 基础显示基类
 * @author 
 *
 */
class BaseDisplay extends eui.Component 
{
    public constructor() 
    {
        super();
        this.addEventListener(egret.Event.ADDED_TO_STAGE, this.onAddToStage, this);
        this.addEventListener(egret.Event.REMOVED_FROM_STAGE, this.onRemoveFromStage, this);
    }
    	
    private onAddToStage(event: eui.UIEvent):void
    {
        this.onCreate();
    }
    	
    private onRemoveFromStage(event: eui.UIEvent):void
    {
        this.removeEventListener(egret.Event.ADDED_TO_STAGE, this.onAddToStage, this);
        this.removeEventListener(egret.Event.REMOVED_FROM_STAGE, this.onRemoveFromStage, this);
        this.onExit();
    }
    	
    protected onCreate(): void
    {
        this.initAllEventListener();
    }
     
    protected onExit(): void
    {
        this.deleteAllEventListener();
        if(this.$children.length > 0){
            this.removeChildren();
        }
    }
        
    // 初始化当前所有事件监听
    protected initAllEventListener():void
    {
        // todo
    }
        
    // 移除当前所有事件监听
    protected deleteAllEventListener():void
    {
        // todo
    }
	
	
}
